package yiminsu.com.cn.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import yiminsu.com.cn.service.LeisurehotelUserService;
import yiminsu.com.cn.utils.ResultsUtil;

@Controller
@RequestMapping("/user")
public class LeisurehotelUserController {
	
	@Autowired
	private LeisurehotelUserService  leisurehotelUserService;
	
	private ResultsUtil resultsUtil;
	
	/**
	 * 新增子账号
	 * @param userId  用户Id
	 * @param userName 用户名
	 * @param phone 电话号码
	 * @param msid
	 * @return
	 */
	@RequestMapping("/insertUser")
	@ResponseBody
	public ResultsUtil insertUser(@RequestParam("userId") String userId,@RequestParam("userName") String userName,@RequestParam("phone") String phone,@RequestParam("msid") String msid) {
		resultsUtil = leisurehotelUserService.insertUser(userId, userName,phone,msid);
		return resultsUtil;
	}
	
	@RequestMapping("/getUserList")
	@ResponseBody
	public ResultsUtil getUser(@RequestParam("userId") String userId) {
		
		
		return leisurehotelUserService.getUser(userId);
	}
	
	
	@RequestMapping("/getUserHotelsketch")
	@ResponseBody
	public ResultsUtil getUserHotelsketch(@RequestParam("userId") String userId) {
		
		return leisurehotelUserService.getUserHotelsketch(userId);
	}
}
